package com.designpatterns.ProducerConsumer;

/**
 * Created by 41579 on 2017/6/8.
 */
public class Consumer implements Runnable{
    private ProducerConsumerBridgeNew bridge;

    public Consumer(ProducerConsumerBridgeNew bridge) {
        this.bridge = bridge;
    }

    @Override
    public void run() {
        try {
            while (true) {
                bridge.consume();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
